package avicit.bdp.dms.perm.dto;

import avicit.bdp.common.base.BaseDTO;
import avicit.platform6.core.annotation.log.FieldRemark;
import avicit.platform6.core.annotation.log.Id;
import avicit.platform6.core.annotation.log.LogField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * @金航数码科技有限责任公司
 * @作者：developer
 * @邮箱：developer@avic-digital.com
 * @创建时间： 2021-03-25
 * @类说明：DataSecretDto
 * @修改记录：
 * @注意事项：
 * @主要功能：密级管理Dto
 */
@ApiModel(value = "DataSecretDTO", description = "密级管理Dto")
@Table(name = "bdp_dms_secret_data")
public class DataSecretDTO extends BaseDTO {
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @Id
    @LogField
    @ApiModelProperty(value = "主键")
    @FieldRemark(column = "id", field = "id", name = "id")
    @javax.persistence.Id
    @Column(name = "id")
    private String id;

    /**
     * 密级拦截的用户列表
     */
    @LogField
    @ApiModelProperty(value = "密级拦截用户列表,多个用户Id使用英文逗号隔开")
    @FieldRemark(column = "user_id_list", field = "user_id_list", name = "密级拦截用户列表")
    @Column(name = "user_id_list")
    private String userIdList;

    /**
     * 行权限-自定义where条件
     */
    @ApiModelProperty(value = "用户列表对应中文名称")
    @Transient
    private String cnUserIdList;

    public String getId() {
        return id;
    }

    public String getUserIdList() {
        return userIdList;
    }

    public String getCnUserIdList() {
        return cnUserIdList;
    }

    public void setId(String id) {
        this.id = id;
    }

    public void setUserIdList(String userIdList) {
        this.userIdList = userIdList;
    }

    public void setCnUserIdList(String cnUserIdList) {
        this.cnUserIdList = cnUserIdList;
    }

    @Override
    public String getLogFormName() {
        if (StringUtils.isEmpty(super.logFormName)) {
            return "密级管理";
        } else {
            return super.logFormName;
        }
    }

    @Override
    public String getLogTitle() {
        if (StringUtils.isEmpty(super.logTitle)) {
            return "密级";
        } else {
            return super.logTitle;
        }
    }

}